import request from './index'

/**
 * 获取菜单数据
 */
function initMenu () {
  const result = request({
    url: '/config/sysmenu',
    method: 'post'
  })
  return result
}

/**
 * 获取验证码
 */
function getVerificationCode () {
  const result = request({
    url: '/sysuser/getVerificationCode',
    method: 'get'
  })
  return result
}

/**
 * 用户登录
 * @param {*} userName
 * @param {*} passWord
 * @param {*} verifyCode
 */
function UserLogin (userName, passWord, verifyCode) {
  const result = request({
    url: '/sysuser/login',
    method: 'post',
    data: {
      userName,
      passWord,
      verifyCode
    }
  })
  return result
}

export default {
  initMenu,
  getVerificationCode,
  UserLogin
}
